import { useState, useEffect } from "react";
import { message } from "antd";
import "@/assets/theme.css";

import { routerArr, routers } from "./router/router";
import { BrowserRouter, Route, Routes, RouterProvider } from "react-router-dom";
function App() {
  //   const location = useLocation();
  const [breadcrumbs, setBreadcrumbs] = useState([]);
  //   useEffect(() => {
  //     // 每次路由变化时，添加新的面包屑
  //     console.log(location);
  //     // const pathnames = location.pathname.split("/").filter((x) => x);
  //     // const newBreadcrumbs = pathnames.map((_, index) => {
  //     //   const path = `/${pathnames.slice(0, index + 1).join("/")}`;
  //     //   const route = findRouteByPath(path);
  //     //   return { path, name: route.breadcrumb };
  //     // });
  //     // console.log(newBreadcrumbs);
  //     // setBreadcrumbs(newBreadcrumbs);
  //   }, [location]);
  return (
    <>
      <RouterProvider router={routers}></RouterProvider>
    </>
  );
}

export default App;
